export default {
  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    title: "全面健康网-健康常识-慢性疾病预防-生理病理-养生保健知识",
    htmlAttrs: {
      lang: "en",
    },
    meta: [
      { charset: "utf-8" },
      { name: "viewport", content: "width=device-width, initial-scale=1" },
      { hid: "description", name: "description", content: "" },
      { name: "format-detection", content: "telephone=no" },
    ],
    link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: [
    "element-ui/lib/theme-chalk/index.css",
    {
      src: "assets/css/common.less",
      lang: "less",
    },
    {
      src: "swiper/css/swiper.css",
    },
    "@/assets/iconfont/iconfont.css",
    // '@/assets/theme/index.css' //element-ui使用第一种自动生成的方法（较复杂，内存占用大）
    { src: "~assets/css/scss/element-variables.scss", lang: "scss" },
    "quill/dist/quill.snow.css",
    "quill/dist/quill.bubble.css",
    "quill/dist/quill.core.css",
    'vant/lib/index.css',
  ],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [
    "@/plugins/element-ui",
    // { src: "@/plugins/mock", ssr: true },
    { src: "@/plugins/swiper.js", ssr: false },
    { src: "@/plugins/vue-seamless-scroll", ssr: false },
    { src: "@/plugins/vue-quill-editor", ssr: false },
    { src: "@/plugins/cropper", ssr: false },
    // { src: "@/plugins/image-crop-upload", ssr: false },
    "@/plugins/axios",
    '@/plugins/api',
    { src: '@/plugins/loading', ssr: false },
    '@plugins/vue-qriously.js',
    '@/plugins/vue-clipboard2.js',
    { src: '~/plugins/global.js', ssr: false },
    '@/plugins/vant-ui',
    // { src: '@/plugins/vuex-persistedstate', ssr: false },
  ],
  // serverMiddleware: [
  //   {
  //     path: '/',
  //     handler: '@/middleware/pageCache.js',
  //   },
  // ],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [
    "@nuxtjs/style-resources",
    'cookie-universal-nuxt',
    // ['cookie-universal-nuxt', { alias: 'cookiz' }],
    '@nuxtjs/axios',
    // '@nuxtjs/proxy',
    // 简单的用法
    '@nuxtjs/component-cache',

    // 配置选项
    // [
    //   '@nuxtjs/component-cache',
    //   {
    //     max: 10000,
    //     maxAge: 1000 * 60 * 60
    //   }
    // ]
  ],
  router: {
    middleware: 'mobilePcChange',
  },
  server: {
    host: '0.0.0.0', // 对外访问
    port: 3000
  },
  // axios:{
  //   proxy:true,
  //   prefix:'/api',
  //   credentials:true,
  // },
  // proxy:{
  //   '/api':'http://47.102.152.158:8080',
  // },
  // proxy: {
  //   '/api': {
  //     target: 'http://47.102.152.158:8080', // 目标接口域名
  //     changeOrigin: true, // 表示是否跨域
  //     pathRewrite: {
  //       '^/api': '/', // 把 /api 替换成 /
  //     }
  //   }
  // },
  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
    // analyze: true,
    // vendor: ['axios'], //为防止重复打包
    transpile: [/^element-ui/],
    // 按需引入element-ui
    // babel: {
    //   plugins: [
    //     [
    //       "component",
    //       { libraryName: "element-ui", styleLibraryName: "theme-chalk" },
    //     ],
    //   ],
    // },
  },
  styleResources: {
    less: ["./assets/css/common.less"],
  },
};
